package com.scs.application.modules.sys.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.scs.application.core.service.BaseServiceImpl;
import com.scs.application.modules.sys.entity.DictData;
import com.scs.application.modules.sys.mapper.DictDataMapper;
import com.scs.application.modules.sys.service.DictDataService;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 */
@Service
public class DictDataServiceImpl extends BaseServiceImpl<DictDataMapper, DictData> implements DictDataService {

    @Override
    public Boolean isSupport(Boolean flagProject) {
        return flagProject;
    }


    /**
     * @Description：获取标签名
    */
    @Override
    public String getLabelByValue(String dictTypeCode, String value) {
        DictData dictData = this.getOne(Wrappers.<DictData>query().eq("dict_type_code", dictTypeCode).eq("value", value),false);
        if (dictData != null) {
            return dictData.getLabel();
        }
        return value;
    }
}
